"""
@Filename: tools/operate_ini
@Author: yoko
@Time: 2023/3/29 15:32
@Describe: ...
"""
from pathlib import Path

from iniconfig import IniConfig


def load_ini():
    path=Path("./pytest.ini")
    print(path.absolute())
    if not path.exists():
        print("文件不存在")
        return {}
    #判断[apitest]是否存在
    ini=IniConfig("./pytest.ini")
    # print(ini.sections)
    if "apitest" not in ini.sections:
        return {}

    return dict(ini['apitest'].items())
load_ini()